package com.eryos.android.cigarettecounter.beans;

import java.io.Serializable;

/**
 * Project : CigaretteCounter Author : Olivier Combe URL : http://eryos.fr/CigaretteCounter/
 * 
 * Copyright(C)2011 - Olivier Combe
 * 
 * Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 * 
 * @version \$Revision.*\$
 * @author Olivier Combe
 */
public class History implements Serializable {

    static final long serialVersionUID = 7717637493458101747L;

    public enum Type {
        WEEKLY, MONTHLY
    }

    private Type type;

    public History() {

    }

    public History(final Type _type) {
        type = _type;
    }

    public final Type getType() {
        return type;
    }

    public final void setType(final Type type) {
        this.type = type;
    }

    public final boolean isMonthly() {
        return type == Type.MONTHLY;
    }

    public final boolean isWeekly() {
        return type == Type.WEEKLY;
    }

    @Override
    public final String toString() {
        switch (type) {
        case WEEKLY:
            return "Weekly";
        case MONTHLY:
            return "Monthly";
        default:
            return "Unknown";
        }
    }
}
